﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpeedTest
{
	public class Filter
	{
		private string planID = String.Empty;
		private string environment = String.Empty;
		private string assignedTester = String.Empty;
		private List<string> results = new List<string>();
        private bool includeNotRun = false;
		private string allResults = String.Empty;

		public string Plan
		{
			get
			{
				return planID;
			}
			set
			{
				planID = value;
			}
		}

		public string Environment
		{
			get
			{
				return environment;
			}
			set
			{
				environment = value;
			}
		}

		public string AssignedTester
		{
			get
			{
				return assignedTester;
			}
			set
			{
				assignedTester = value;
			}
		}

		public string AllResults
		{
			get
			{
				return allResults;
			}
			set
			{
				allResults = value;
			}
		}

		public List<string> Results
		{
			get
			{

				return results;
			}
			set
			{
				results = value;
			}
		}

        public bool IncludeNotRun
        {
            get
            {
                return includeNotRun;
            }
            set
            {
                includeNotRun = value;
            }
        }

		public void CreateResultsList()
		{
			allResults = string.Empty;

			if (results.Count > 0)
			{
				for (int i = 0; i < results.Count; i++)
				{
					if (results[i].ToUpper().Equals("NOT RUN"))
					{
						this.IncludeNotRun = true;
					}
					else
					{
						allResults += "'" + results[i].ToUpper() + "'";
						if (i != results.Count - 1) { allResults += ", "; }
					}
				}
			}
		}
	}
}
